import React, {FC, useContext} from 'react';
import JournalArticleList from "@/pages/JournalPage/JournalDetail/commons/JournalArticleList";
import JournalDefaultLayout from "@/pages/JournalPage/JournalDetail/commons/JournalDefaultLayout";
import {JournalDetailContext} from "@/pages/JournalPage/JournalDetail/commons/JournalDetailContext";
import JournalIntroduction from "@/pages/JournalPage/JournalDetail/JournalIntroduction";

interface JournalDetailHomeProps {
}

const JournalDetailHome: FC<JournalDetailHomeProps> = (props) => {
  const {journal} = useContext(JournalDetailContext)
  const isCn = journal?.languageType === "CN";

  return (
    <JournalDefaultLayout includeHotArticles={isCn} includeNews={isCn}>
      {isCn ? (
        <JournalArticleList/>
      ) : (
        <JournalIntroduction/>
      )}

    </JournalDefaultLayout>
  );
};

export default JournalDetailHome;
